<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //将其他数据类型转化为 Boolean
        // 除了 0  ""  null  undefined  NaN 为false，其他都是true

        // console.log(Boolean(0));
        // console.log(Boolean(""));
        // console.log(Boolean(null));
        // console.log(Boolean(undefined));
        // console.log(Boolean(NaN));

        // console.log(Boolean(123));
        // console.log(Boolean("hello"));
        // console.log(Boolean([]));

        //! 非(反过来)   将后面的内容变成boolean,然后反过来
        //!! --- Boolean()
        // console.log(!!null);
        // console.log(!!undefined);

        // console.log(!null);// !false  true
        // console.log(!!null);// !!false  !true  false

        console.log(Boolean("16px"))//true
        console.log(Boolean("0"))//true
        console.log(Boolean("null"))//true
        
    </script>
</body>
</html>